/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apt.professionaltag.Process;

import com.apt.tag.Connect_DB;
import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *
 * @author Bach
 */
public class DisableProfessional {

    

    public static boolean setDisableProfessional(String professinal_Name) {
        String up = "UPDATE [Matrimony].[dbo].[Professional_Types] SET [Professional_Status] = 0 WHERE [Professinal_Name]=?";
        boolean re = false;
        Connection con = null;
        PreparedStatement ps = null;
        try {
            con = Connect_DB.getConnection();
            ps = con.prepareStatement(up);
            ps.setString(1, professinal_Name);
            int i = ps.executeUpdate();
            if (i > 0) {
                re = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            Connect_DB.close(null, null, ps, con);
        }
        return re;
    }
}
